package com.shadow.cloud.security.entity.rel;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@TableName("cloud_role_permission")
public class RelRolePermissionEntity {

    /** 主键id */
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    private String roleId;
    private String permissionId;

    /**
     * 创建时间.
     **/
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    public RelRolePermissionEntity(String roleId, String permissionId) {
        this.roleId = roleId;
        this.permissionId = permissionId;
    }
}